package com.example.origin.finance.enums;

import com.example.origin.finance.trade.dto.Analyst;
import com.example.origin.finance.trade.dto.impl.RedAnalyst;
import com.example.origin.finance.trade.dto.impl.RedUsAnalyst;
import com.example.origin.finance.trade.dto.impl.RedUsJiJinAnalyst;
import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum AnalystEnum {

    RED_ANALYST(TableNameEnum.XUEQIU_GUPIAO_KLINE,TableNameEnum.XUEQIU_GUPIAO_QUOTE, new RedAnalyst(),1),
    RED_US_ANALYST(TableNameEnum.XUEQIU_GUPIAO_KLINE_US,TableNameEnum.XUEQIU_GUPIAO_QUOTE_US, new RedUsAnalyst(),2),
    RED_US_JIJIN_ANALYST(TableNameEnum.XUEQIU_JIJIN_KLINE_US,TableNameEnum.XUEQIU_JIJIN_QUOTE_US, new RedUsJiJinAnalyst(),3),
    ;

    private TableNameEnum klineTableNameEnum;
    private TableNameEnum quoteTableNameEnum;
    private Analyst analyst;
    private Integer model;

    public static AnalystEnum get(Integer model) {
        for (AnalystEnum value : values()) {
            if (value.getModel().equals(model)) {
                return value;
            }
        }
        return null;
    }
}
